// appfront/src/api/api.js
import axiosInstance from './index'

const axios = axiosInstance
const plotService='plot/'
const experimentsService='experiments'
const experiService='experiment/'

//封装axios的接口
export const getPlotByExperimentName=(experimentName, type, parameter)=>{
    return axios.get(plotService+experimentName+'/'+type+'/'+parameter)
}

export const getAllExperiments=()=>{
    return axios.get(experimentsService)
}

export const createExperiment=(exp_name,ax_config)=>{

    return axios.post(experiService+exp_name,ax_config)
}

export const getExperimentByName=(experimentName)=>{
    return axios.get(experiService+experimentName)
}

export const getParametersByExperimentName=(experimentName)=>{
    return axios.get(plotService+"parameters/"+experimentName)
}